const { randomCenter } = require("../../../../common/compute")
const { debuger } = require("../../../../common/debuger")
const Processor = function() {
    this.process = function(type, object, runtime) {
        if (object == undefined || object.x == undefined || object.w <= 20 || object.h <= 20) {
            return false
        }
        debuger.add(object)
        sleep(500)
        let target = randomCenter(object, 10)
        console.log("获取到点击坐标:" + JSON.stringify(target))
        click(target.x, target.y)
        debuger.refresh()
        return true
    }
}

exports.matchClickProcessor = new Processor() 